package exception;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始");
        FileOutputStream fos=null;
        try {
            fos=new FileOutputStream("./1/2/3.txt");
        } catch (IOException e) {
            System.out.println("IO异常并解决");
        }finally {
            try {
                fos.close();
            } catch (Exception e) {
                System.out.println("关闭异常并解决");
            }
        }
        System.out.println("关闭程序");
    }
}
